import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";
import type { inspectorType } from "@/store/types";

export type InspectorResult = {
  code: number;
  message: string;
  data: {
    list: {
      inspector: inspectorType;
    };
  };
};

/** 获取反馈列表 */
export const getInspectorList = (data: {
  inspectorParam: {};
  pageSize: number;
  pageNum: number;
}) => {
  return http.request<InspectorResult>(
    "post",
    baseUrlApi(
      // "/epms/inspector/getInspectorList" +
      "/inspector/getInspectorList" +
      "?pageSize=" +
      data.pageSize +
      "&pageNum=" +
      data.pageNum
    ),
    {
      data: data.inspectorParam
    }
  );
};

/** 获取反馈表总页数 */
export const getInspectorListTotalPage = (data: {
  inspectorParam: {};
  pageSize: number;
}) => {
  return http.request(
    "post",
    baseUrlApi(
      // "/epms/inspector/getInspectorListTotalPage" +
      "/inspector/getInspectorListTotalPage" + "?pageSize=" + data.pageSize
    ),
    {
      data: data.inspectorParam
    }
  );
};
